﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="Warning_Detail.aspx.vb" Inherits="Travelling_Alone.Warning_Detail" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
<style type="text/css">
.ratingStar 
{
    margin: 0px;
    padding: 0px;
    width: 25px;
    height: 25px;
    font-size: 0pt;
    cursor: pointer;
    display: block;
    background-repeat: no-repeat;
}

.filledRatingStar
{
    background-image: url(Rating_Control_Images/filled_star.png);
}

.emptyRatingStar
{
    background-image: url(Rating_Control_Images/empty_star.png);
}

.savedRatingStar
{
    background-image: url(Rating_Control_Images/rating_star_saved.png);
}

</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    
    <asp:GridView ID="GridView_Title" CssClass="contentTitle_Warnings" 
        runat="server" DataSourceID="SqlDataSource1" 
        AutoGenerateColumns="False" HorizontalAlign="Left">
        <Columns>
            <asp:BoundField DataField="the_title">
            </asp:BoundField>
        </Columns>
    </asp:GridView>

    <asp:GridView ID="GridView1_WrittenBy" 
        runat="server" DataSourceID="SqlDataSource1" 
        AutoGenerateColumns="False" HorizontalAlign="Center">
        <Columns>
            <asp:HyperLinkField DataNavigateUrlFields="the_author" 
                DataNavigateUrlFormatString="Profile.aspx?TravellerName={0}" 
                DataTextField="the_author" HeaderText="Written By" ItemStyle-HorizontalAlign="Center" />
        </Columns>
    </asp:GridView>
    <br />

    <asp:GridView ID="GridView_Main" CssClass="contentText_Warnings" 
        runat="server" DataSourceID="SqlDataSource1" 
        AutoGenerateColumns="False" HorizontalAlign="Left">
        <Columns>
            <asp:ImageField DataImageUrlField="the_photo" ControlStyle-Width="400px" ControlStyle-Height="300px" DataImageUrlFormatString="{0}"></asp:ImageField>
            <asp:BoundField DataField ="the_description" />
        </Columns>
    </asp:GridView>

    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:TravellingAloneConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:TravellingAloneConnectionString.ProviderName %>" 
        SelectCommand="SELECT * FROM [warnings] WHERE ([ID] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="ID" QueryStringField="ID" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
    <br />
    
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConnectionString="<%$ ConnectionStrings:TravellingAloneConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:TravellingAloneConnectionString.ProviderName %>" 
        SelectCommand="SELECT [the_author], [the_comment] FROM [warnings_comments] WHERE ([warnings_fkid] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="warnings_fkid" QueryStringField="ID" 
                Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
    <br />
    <br /> &nbsp;<asp:Button ID="like_btn" runat="server" Text="Like" 
        BackColor="#E6B800" ForeColor="Black"></asp:Button> &nbsp this Warning! &nbsp &nbsp <asp:Label ID="likelbl" BackColor="#99CCFF" ForeColor="#0033CC" runat="server" Text=""></asp:Label> <br /><br />
    <br /> <br />
    <span class="style2">HOW USEFUL DID YOU FIND THIS?</span> &nbsp&nbsp&nbsp<asp:Label ID="thanks_for_rating" runat="server" ForeColor="Green" Font-Bold="true" Text="Your rating was saved, thanks." /> <br />
    
    <ajaxToolkit:ToolkitScriptManager ID="tsm" runat="server" />
    <ajaxToolkit:Rating ID="Rating1" runat="server"
                BehaviorID="RatingBehaviour1"
                RatingDirection="LeftToRightTopToBottom"
                StarCssClass="ratingStar"
                WaitingStarCssClass="savedRatingStar"
                FilledStarCssClass="filledRatingStar"
                EmptyStarCssClass="emptyRatingStar" AutoPostBack="False" /> 

    &nbsp &nbsp &nbsp <asp:Button ID="rating_submit_button" runat="server" Text="Rate" />

                
    <br />
    <br />
    <br />
    <br />
    <span class="style2">COMMENTS FOR THIS WARNING</span><br />
    <br />
    <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
        CellPadding="4" ForeColor="#333333" GridLines="None" HorizontalAlign="Left">
        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:BoundField DataField="the_author" HeaderText="Traveller" />
            <asp:BoundField DataField="the_comment" HeaderText="Comment" />
        </Columns>
        <EditRowStyle BackColor="#2461BF" />
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="Gray" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#d1d1d1" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#F5F7FB" />
        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
        <SortedDescendingCellStyle BackColor="#E9EBEF" />
        <SortedDescendingHeaderStyle BackColor="#4870BE" />
    </asp:GridView>
    <br /> <br /> <br /><br /> <br /> <br /><br /> <br /> <br /> <br />
    <span class="style3">ADD A COMMENT</span><br />
    <br />
    <asp:TextBox ID="tb_comment" runat="server" Height="99px" Width="399px" 
        TextMode="MultiLine"></asp:TextBox>
&nbsp;
    

    <br />
    <asp:Button ID="btn_submit" runat="server" Text="Submit"/>
    <br />
    <br />

</asp:Content>
